package cn.edu.ujn.ch03.c;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;

import cn.edu.ujn.ch03.m.Xsb;

public class SaveAction extends ActionSupport{
	
	private Xsb xs;
	public Xsb getXs() {
		return xs;
	}
	public void setXs(Xsb xs) {
		this.xs = xs;
	}
	private List<Xsb> xslist=new ArrayList<Xsb>();
	
	
	public List<Xsb> getXslist() {
		return xslist;
	}
	public void setXslist(List<Xsb> xslist) {
		this.xslist = xslist;
	}
	public String execute() throws Exception {
		Xsb stu=new Xsb();
		stu.setXh(xs.getXh());
		stu.setXm(xs.getXm());
		if("liukun".equals(stu.getXm())){
			xslist.add(stu);
			xslist.add(stu);
			return "ok";
		}else
			return "error";
	}
	
	public String login() {
		xslist.add(xs);
		xslist.add(xs);
		xslist.add(xs);
		return "ok";
	}

	public String check() {
		xslist.add(xs);
		xslist.add(xs);
		xslist.add(xs);
		return "ok";
	}

}
